﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
<div>
    <form id="uploadForm">
        AJAX上传多文件： <input type="file" name="file" multiple />
        <input type="button" value="上传" onclick="doUpload()" />
        <input type="hidden" id="filename" />
        <a href="#" id="texta" onclick="Load()">cont22222ent</a>
    </form>
</div>
<script type="text/javascript">
     function doUpload() {
        var formData = new FormData($("#uploadForm")[0]);
        $.ajax({
            url: '../RenYuan/FileSave',
            type: 'POST',
            data: formData,
            async: false,
            cache: false,
            contentType: false,
            processData: false,
            success: function (returndata) {
                $('#filename').val(returndata);
                alert("上传成功");
            },
            error: function (returndata) {
                alert(returndata);
            }
        });
    }
    function Load() {
        window.location.href = "../upload/" + $('#filename').val();
    }
</script>
@*所有东西都是必须的 导入的包也是固定的*@